﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace PSE.Deployment.SetupBase.Configuration
{
    [Serializable]
    [XmlType("Folder")]
    public class FolderInfo
    {
        [XmlAttribute()]
        public string Source { get; set; }
        [XmlAttribute()]
        public string Destination { get; set; }
        [XmlArrayItem("FileName")]
        public List<string> Files { get; set; }
        [XmlArrayItem("FileName")]
        public List<string> IgnoreFiles { get; set; }

        public FolderInfo()
        {
            Files = new List<string>();
            IgnoreFiles = new List<string>();
        }

        public static bool operator ==(FolderInfo a, FolderInfo b)
        {
            return a.Source == b.Source && b.Destination == b.Destination;
        }

        public static bool operator !=(FolderInfo a, FolderInfo b)
        {
            return a.Source != b.Source || b.Destination != b.Destination;
        }

        public override int GetHashCode()
        {
            return this.Source.GetHashCode() + this.Destination.GetHashCode();
        }
    }
}
